<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>

<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>back/main/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="<%=basePath%>back/main/css/main.css"/>
    <script type="text/javascript" src="<%=basePath%>back/main/js/libs/modernizr.min.js"></script>
</head>
<body>
<div class="crumb-wrap">
    <div class="crumb-list"><i class="icon-font"></i><span class="crumb-name">菜谱管理</span></div>
</div>
<div class="result-wrap">

    <div class="result-content">
        <table class="result-tab" width="100%">
            <tr>
                <th>ID</th>
                <th>菜谱图片</th>
                <th>标题</th>
                <th>操作</th>
            </tr>
            <c:forEach items="${pageInfo.list}" var="menu">
                <tr>
                    <td>${menu.id}</td>
                    <td><img src="<%=basePath%>${menu.img}" style="width: 50px;height: 50px;"></td>
                    <td >${menu.title}</td>
                    <td>
                        <a class="link-update" href="<%=basePath%>pri/back/selectbyid?id=${menu.id}">修改</a>
                        <a class="link-del" href="<%=basePath%>pri/back/typedelete?id=${type.id}">删除</a>
                    </td>
                </tr>
            </c:forEach>
        </table>
        <div class="list-page">
            <a href="<%=basePath%>pri/back/menulist">首页</a>
            <a href="<%=basePath%>pri/back/menulist?pageNum=${pageInfo.hasPreviousPage==true?pageInfo.prePage:1}">上一页</a>
            <a href="<%=basePath%>pri/back/menulist?pageNum=${pageInfo.hasNextPage==true?pageInfo.nextPage:pageInfo.pages}">下一页</a>
            <a href="<%=basePath%>pri/back/menulist?pageNum=${pageInfo.pages}">尾页</a>
        </div>
    </div>
</div>
</body>
</html>